<template>
  <div id="app">
    <router-view />
  </div>
</template>

<style lang="scss">
#app {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  color: #303133;
}
</style>

<script>
export default {
  //初始化全局配置
  mounted() {
    //异步请求整个网站的全局设置并且保存到vueX中
    //获取url
    let url = this.$store.state.globalSettings.apiUrl + "/settings";
    this.axios.get(url).then((res) => {
      console.log(res.data);

      //存入vuex
      this.$store.commit("setGlobalSettings", res.data);
    });
  },
};
</script>
